import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        boolean running = true;

        while (running) {
            System.out.println("\n1. 记录收入");
            System.out.println("2. 记录支出");
            System.out.println("3. 退出");
            System.out.print("请选择一个操作: ");

            String choice = scanner.nextLine();

            switch (choice) {
                case "1":
                    recordIncome(scanner);
                    break;
                case "2":
                    recordExpense(scanner);
                    break;
                case "3":
                    running = false;
                    System.out.println("退出程序");
                    break;
                default:
                    System.out.println("无效输入，请重新选择");
            }
        }

        scanner.close();
    }

    private static void recordIncome(Scanner scanner) {
        System.out.print("请输入收入金额: ");
        double income = scanner.nextDouble();
        System.out.println("记录收入: " + income + "元");
    }

    private static void recordExpense(Scanner scanner) {
        System.out.print("请输入支出金额: ");
        double expense = scanner.nextDouble();
        System.out.println("记录支出: " + expense + "元");
    }
}
